<?php

namespace Api\Sms\ZhuTong;

use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Api\Sms\Models\SmsVerificationCode;

/**
 * 服务提供者
 */
class ServiceProvider extends BaseServiceProvider
{
    /**
     * Register any application services.
     * 服务注册时执行，此处仅可用于注册 Ioc 绑定
     * @return void
     */
    public function register()
    {
        // 注册配置文件
        config()->set('Sms\ZhuTong', require __DIR__.'/config.php');
        
        // Ioc 绑定
        $this->app->bind('Api\Sms\SmsRepository', function () {
            return new Repository(new SmsVerificationCode, config('Sms\ZhuTong'));
        });
    }

}
